import { resolve } from 'path'

const root = resolve(__dirname, '../../')

const BaseAlias = {
  '~': root,
  '@': resolve(root, './src'),
  '@common': resolve(root, './src/common')
}

export const useMainResolve = () => {
  return {
    alias: {
      ...BaseAlias,
      '@main': resolve(root, './src/main')
    }
  }
}

export const usePreloadResolve = () => {
  return {
    alias: {
      ...BaseAlias,
      '@preload': resolve(root, './src/preload')
    }
  }
}

export const useRenderResolve = () => {
  return {
    alias: {
      ...BaseAlias,
      '@renderer': resolve(root, './src/renderer/src')
    }
  }
}
